package com.tony.aop.service.impl;

import com.tony.aop.service.HelloWordService;
import org.springframework.stereotype.Service;

@Service("hw")
public class HelloWordService2Impl implements HelloWordService {
    public void printHelloWorld() {
        System.out.println("Hello World2!!!");
    }

    public void doPrint() {
        try {
            System.out.println(this.getClass().getDeclaredMethod("doPrint2",
                    new Class[]{}).getName()+"###############");
        } catch (NoSuchMethodException e) {
            e.printStackTrace();
        } catch (SecurityException e) {
            e.printStackTrace();
        }
    }

    public String dealName(String name) {
        System.out.println("名字2是："+name);
        return "my name is "+name;
    }
}
